package com.googlecode.everyidea.core.dao;

import com.googlecode.everyidea.core.model.Function;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class FunctionDAOImpl extends SqlMapClientDaoSupport implements FunctionDAO {

    /**
     * 
     * This method corresponds to the database table S_FUNCTION
     *
     * 
     */
    public FunctionDAOImpl() {
        super();
    }

    /**
     * 
     * This method corresponds to the database table S_FUNCTION
     *
     * 
     */
    public void insert(Function record) {
        getSqlMapClientTemplate().insert("S_FUNCTION.insert", record);
    }

    /**
     * 
     * This method corresponds to the database table S_FUNCTION
     *
     * 
     */
    public int updateByPrimaryKey(Function record) {
        int rows = getSqlMapClientTemplate().update("S_FUNCTION.updateByPrimaryKey", record);
        return rows;
    }

    /**
     * 
     * This method corresponds to the database table S_FUNCTION
     *
     * 
     */
    public int updateByPrimaryKeySelective(Function record) {
        int rows = getSqlMapClientTemplate().update("S_FUNCTION.updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * 
     * This method corresponds to the database table S_FUNCTION
     *
     * 
     */
    public Function selectByPrimaryKey(String functionId) {
        Function key = new Function();
        key.setFunctionId(functionId);
        Function record = (Function) getSqlMapClientTemplate().queryForObject("S_FUNCTION.selectByPrimaryKey", key);
        return record;
    }

    /**
     * 
     * This method corresponds to the database table S_FUNCTION
     *
     * 
     */
    public int deleteByPrimaryKey(String functionId) {
        Function key = new Function();
        key.setFunctionId(functionId);
        int rows = getSqlMapClientTemplate().delete("S_FUNCTION.deleteByPrimaryKey", key);
        return rows;
    }
}